
function ResolveUnkownParty(sPartyName)
{
var lookupItem = event.srcElement;


while (lookupItem.tagName != "SPAN" || lookupItem.wrapper == "true")
{
lookupItem = lookupItem.parentElement;
}

var url = prependOrgName("/_controls/partylist/resolve.aspx?address=" + CrmEncodeDecode.CrmUrlEncode(sPartyName));
var returnObject = openStdDlg(url, null, 450, 450);
if (returnObject)
{

lookupItem.oid = returnObject.id;
lookupItem.otype = returnObject.type;
lookupItem.onclick = openlui;
lookupItem.className = "ms-crm-Lookup-Item";
lookupItem.category = "";
lookupItem.data = "";
lookupItem.unselectable = "on";
lookupItem.firstChild.innerHTML = "<img alt='' class='ms-crm-Lookup-Item' src='/_imgs/ico_16_" + returnObject.type + ".gif'>" + CrmEncodeDecode.CrmHtmlEncode(returnObject.name);


lookupItem.parentElement.parentElement.nextSibling.firstChild.ForceSubmit = true;
}
}

function OpenItemForceSubmit()
{
openlui();


var lookupItem = event.srcElement;
lookupItem.parentElement.parentElement.parentElement.nextSibling.firstChild.DefaultValue = null;
}
